﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<InvoiceInvoker.MvcUI.Models.SellerModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Profil - InvoiceInvoker
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script src="/Scripts/MicrosoftAjax.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"></script>
    <script src="/Scripts/MicrosoftMvcValidation.js" type="text/javascript"></script>
	<script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript""></script>

	<script type="text/javascript">
		$(function () {
			$("#defaultFormat").click(function (event) {
				$("#invoiceNumberFormat").val('<%: InvoiceInvoker.Logic.InvoiceNumber.DefaultFormat %>');
				event.preventDefault();
			});
		});
	</script>

    <h2>Twój profil: <i><%: ViewData["Message"] %></i></h2>

    <% Html.EnableClientValidation(); %>

    <% using (Html.BeginForm()) {%>

    <table class="transparent">
        <tr>
            <td><b>Dane osobowe:</b></td>
            <td></td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.FirstName) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.FirstName) %>
                <%: Html.ValidationMessageFor(model => model.FirstName) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.LastName) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.LastName) %>
                <%: Html.ValidationMessageFor(model => model.LastName) %>
            </td>
        </tr>
        <tr>
            <td><b>Dane firmy:</b></td>
            <td></td>
        </tr>
        <tr>
            <td align="right"> <%: Html.LabelFor(model => model.CompanyName) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.CompanyName) %>
                <%: Html.ValidationMessageFor(model => model.CompanyName) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.Street) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.Street) %>
                <%: Html.ValidationMessageFor(model => model.Street) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.City) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.City) %>
                <%: Html.ValidationMessageFor(model => model.City) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.PostalCode) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.PostalCode) %>
                <%: Html.ValidationMessageFor(model => model.PostalCode) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.Nip) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.Nip) %>
                <%: Html.ValidationMessageFor(model => model.Nip) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.Regon) %> <i>(niewymagany)</i>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.Regon) %>
                <%: Html.ValidationMessageFor(model => model.Regon) %>
            </td>
        </tr>
        <tr>
            <td><b>Konto bankowe:</b></td>
            <td></td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.BankName) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.BankName) %>
                <%: Html.ValidationMessageFor(model => model.BankName) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.BankSwift) %> <i>(niewymagany)</i>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.BankSwift) %>
                <%: Html.ValidationMessageFor(model => model.BankSwift) %>
            </td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.BankAccountNumber) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.BankAccountNumber) %>
                <%: Html.ValidationMessageFor(model => model.BankAccountNumber) %>
            </td>
        </tr>
        <tr>
            <td><b>Format numeru faktury:</b></td>
            <td><i><%: Html.ActionLink("(więcej)", "InvoiceNumberFormatInfo") %></i></td>
        </tr>
        <tr>
            <td align="right"><%: Html.LabelFor(model => model.InvoiceNumberFormat) %>:</td>
            <td>
                <%: Html.TextBoxFor(model => model.InvoiceNumberFormat, new { id = "invoiceNumberFormat" })%>
				<i><a id="defaultFormat" href="">(domyślny)</a></i>
                <%: Html.ValidationMessageFor(model => model.InvoiceNumberFormat) %>
            </td>
        </tr>
    </table>

    <div class="hidden">
        <%: Html.TextBoxFor(model => model.Id) %>
        <%: Html.TextBoxFor(model => model.UserName) %>
        <%: Html.TextBoxFor(model => model.LastInvoiceNumber) %>
    </div>

    <p>
        <input type="submit" value="Zapisz" />
    </p>

    <% } %>

</asp:Content>
